import org.junit.Test;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

public class test {
    @Test
    public void test1() {
        class User{
            String name;
            public User(String name){this.name=name;}
        }
        HashMap<Integer,User> map1=new HashMap<>();
        HashMap<Integer,User> map2=new HashMap<>();
        map1.put(1,new User("zz"));
        map2.put(1,map1.get(1));
        for (Map.Entry<Integer, User> entry : map2.entrySet()) {
            User s=entry.getValue();
            s.name="z";
        }

        System.out.println(map1.get(1).name);
        System.out.println(map2.get(1).name);
    }
}
